<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<TITLE>
HSSFDataFormatter (POI API Documentation)
</TITLE>


<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="HSSFDataFormatter (POI API Documentation)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/HSSFDataFormatter.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/poi/hssf/usermodel/HSSFDataFormat.html" title="class in org.apache.poi.hssf.usermodel"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/poi/hssf/usermodel/HSSFDataValidation.html" title="class in org.apache.poi.hssf.usermodel"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html?org/apache/poi/hssf/usermodel/HSSFDataFormatter.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="HSSFDataFormatter.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#methods_inherited_from_class_org.apache.poi.ss.usermodel.DataFormatter">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;METHOD</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.poi.hssf.usermodel</FONT>
<BR>
Class HSSFDataFormatter</H2>
<PRE>
java.lang.Object
  <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html" title="class in org.apache.poi.ss.usermodel">org.apache.poi.ss.usermodel.DataFormatter</A>
      <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.poi.hssf.usermodel.HSSFDataFormatter</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD>java.util.Observer</DD>
</DL>
<HR>
<DL>
<DT><PRE>public final class <B>HSSFDataFormatter</B><DT>extends <A HREF="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html" title="class in org.apache.poi.ss.usermodel">DataFormatter</A></DL>
</PRE>

<P>
HSSFDataFormatter contains methods for formatting the value stored in an
 HSSFCell. This can be useful for reports and GUI presentations when you
 need to display data exactly as it appears in Excel. Supported formats
 include currency, SSN, percentages, decimals, dates, phone numbers, zip
 codes, etc.
 <p>
 Internally, formats will be implemented using subclasses of <CODE>Format</CODE>
 such as <CODE>DecimalFormat</CODE> and <CODE>SimpleDateFormat</CODE>. Therefore the
 formats used by this class must obey the same pattern rules as these Format
 subclasses. This means that only legal number pattern characters ("0", "#",
 ".", "," etc.) may appear in number formats. Other characters can be
 inserted <em>before</em> or <em> after</em> the number pattern to form a
 prefix or suffix.
 </p>
 <p>
 For example the Excel pattern <code>"$#,##0.00 "USD"_);($#,##0.00 "USD")"
 </code> will be correctly formatted as "$1,000.00 USD" or "($1,000.00 USD)".
 However the pattern <code>"00-00-00"</code> is incorrectly formatted by
 DecimalFormat as "000000--". For Excel formats that are not compatible with
 DecimalFormat, you can provide your own custom <CODE>Format</CODE> implementation
 via <code>HSSFDataFormatter.addFormat(String,Format)</code>. The following
 custom formats are already provided by this class:
 </p>
 <pre>
 <ul><li>SSN "000-00-0000"</li>
     <li>Phone Number "(###) ###-####"</li>
     <li>Zip plus 4 "00000-0000"</li>
 </ul>
 </pre>
 <p>
 If the Excel format pattern cannot be parsed successfully, then a default
 format will be used. The default number format will mimic the Excel General
 format: "#" for whole numbers and "#.##########" for decimal numbers. You
 can override the default format pattern with <code>
 HSSFDataFormatter.setDefaultNumberFormat(Format)</code>. <b>Note:</b> the
 default format will only be used when a Format cannot be created from the
 cell's data format string.
<P>

<P>
<HR>

<P>

<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/poi/hssf/usermodel/HSSFDataFormatter.html#HSSFDataFormatter()">HSSFDataFormatter</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a formatter using the <CODE>default locale</CODE>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/poi/hssf/usermodel/HSSFDataFormatter.html#HSSFDataFormatter(java.util.Locale)">HSSFDataFormatter</A></B>(java.util.Locale&nbsp;locale)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a formatter using the given locale.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_org.apache.poi.ss.usermodel.DataFormatter"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class org.apache.poi.ss.usermodel.<A HREF="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html" title="class in org.apache.poi.ss.usermodel">DataFormatter</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#addFormat(java.lang.String, java.text.Format)">addFormat</A>, <A HREF="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#createFormat(org.apache.poi.ss.usermodel.Cell)">createFormat</A>, <A HREF="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#formatCellValue(org.apache.poi.ss.usermodel.Cell)">formatCellValue</A>, <A HREF="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#formatCellValue(org.apache.poi.ss.usermodel.Cell, org.apache.poi.ss.usermodel.FormulaEvaluator)">formatCellValue</A>, <A HREF="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#formatRawCellContents(double, int, java.lang.String)">formatRawCellContents</A>, <A HREF="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#formatRawCellContents(double, int, java.lang.String, boolean)">formatRawCellContents</A>, <A HREF="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#getDefaultFormat(org.apache.poi.ss.usermodel.Cell)">getDefaultFormat</A>, <A HREF="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#getLocaleChangedObservable()">getLocaleChangedObservable</A>, <A HREF="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#setDefaultNumberFormat(java.text.Format)">setDefaultNumberFormat</A>, <A HREF="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#setExcelStyleRoundingMode(java.text.DecimalFormat)">setExcelStyleRoundingMode</A>, <A HREF="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#setExcelStyleRoundingMode(java.text.DecimalFormat, java.math.RoundingMode)">setExcelStyleRoundingMode</A>, <A HREF="../../../../../org/apache/poi/ss/usermodel/DataFormatter.html#update(java.util.Observable, java.lang.Object)">update</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="HSSFDataFormatter(java.util.Locale)"><!-- --></A><H3>
HSSFDataFormatter</H3>
<PRE>
public <B>HSSFDataFormatter</B>(java.util.Locale&nbsp;locale)</PRE>
<DL>
<DD>Creates a formatter using the given locale.
<P>
</DL>
<HR>

<A NAME="HSSFDataFormatter()"><!-- --></A><H3>
HSSFDataFormatter</H3>
<PRE>
public <B>HSSFDataFormatter</B>()</PRE>
<DL>
<DD>Creates a formatter using the <CODE>default locale</CODE>.
<P>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/HSSFDataFormatter.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/poi/hssf/usermodel/HSSFDataFormat.html" title="class in org.apache.poi.hssf.usermodel"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/poi/hssf/usermodel/HSSFDataValidation.html" title="class in org.apache.poi.hssf.usermodel"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html?org/apache/poi/hssf/usermodel/HSSFDataFormatter.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="HSSFDataFormatter.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#methods_inherited_from_class_org.apache.poi.ss.usermodel.DataFormatter">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;METHOD</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>

                <i>Copyright 2016 The Apache Software Foundation or
        its licensors, as applicable.</i>
            
</BODY>
</HTML>
